<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Father {
            // constructor() {
            //     // this.name = name;
            // }
            // money() {
            //     console.log(100);

            // }
            constructor(x, y) {
                this.x = x;
                this.y = y;

            }
            sum() {
                console.log(this.x + this.y);

            }
        }
        //继承
        class Son extends Father {
            constructor(x, y) {
                super(x, y); //
            }
        }
        var son_1 = new Son(1, 2);
        // son_1.money();
        // son_1.sum(1, 2);
        son_1.sum();
    </script>
</body>

</html>